<?php
/**
 * Created by PhpStorm.
 * User: gogo
 * Date: 18/4/8
 * Time: 下午1:18
 */
namespace app\exception;

use think\exception\HttpException;

class CustomException extends HttpException
{
    private $statusCode;
    private $headers;

    public function __construct(
        $message = null,
        $code = 0,
        $statusCode=200,
        \Exception $previous = null,
        array $headers = []
    ) {
        $this->statusCode = $statusCode;
        $this->headers = $headers;

        parent::__construct($statusCode, $message, $previous, $headers, $code);
    }

    public function getErrorCode()
    {
        return $this->code;
    }

    public function getHeaders()
    {
        return $this->headers;
    }
}